﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;

namespace FYPDemo
{
    public partial class WebForm13 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string memberName = Session["username"].ToString();
            string dateFrom = "";
            string dateTo = txtDateTo.Text;
            string productID = txtProductID.Text;
            string orderBy = ddlOrderBy.SelectedValue;

            if (txtDateFrom.Text != "")
            {
                dateFrom = txtDateFrom.Text + " 00:00:00.000";
                Session["DateFrom"] = txtDateFrom.Text;
            }
            if (txtDateTo.Text != "")
            {
                dateTo = txtDateTo.Text + " 23:59:59.998";
                Session["DateTo"] = txtDateTo.Text;
            }

            DataTable dt = report.SalesAnalysisReport(memberName, dateFrom, dateTo, productID, orderBy);
            SalesAnalysis_GView.DataSource = dt;
            SalesAnalysis_GView.DataBind();
        }
    }
}